<?php 
		namespace Admin\Model;
		use Think\Model;
		class WebinfoModel extends Model	{
			protected $tableName = 'webinfo';
			
			public function webset($arr){
					$arr["up_date"]=date("Y-m-d H:i:s");
				if(empty($arr["id"])){
					$arr['creat_date']=$arr["up_date"];
					$this->add($arr);
				}else{
					$this->where("id=".$arr['id'])->save($arr);
				}
				return $this->getWebinfo();
			}
			
			public function getWebinfo($id=""){
				$data=C("webinfo");
				if(empty($data)){
					C("webinfo","");
					$data=$this->select();
					$data=arr_rule($data);
					C("webinfo",$data);
				}
				 if(!$id==""){
					return $data[$id];
				}else{
					return $data;
				}
					
			}
			
		}
?>